﻿using System;
using System.Collections.Generic;
using System.Web;

namespace SMS_Server
{
    /// <summary>
    /// iDataAccess abstract class provides an interface
    /// for different database connector class
    /// to use with ruposhi framework
    /// </summary>
    public abstract class iDataAccess
    {
        /// <summary>
        /// Get or Set the CommandString to execute
        /// </summary>
        public abstract string CommandString { get; set; }

        /// <summary>
        /// State of the underlaying data connection of the DataAccess class
        /// </summary>
        public abstract System.Data.ConnectionState State { get; }

        /// <summary>
        /// Add CommandParameter
        /// </summary>
        /// <param name="ParamName"></param>
        /// <param name="value"></param>
        public abstract void AddParameter(string ParamName, object value);

        /// <summary>
        /// Change the value of the parameter by it's name
        /// </summary>
        /// <param name="ParamName"></param>
        /// <param name="value"></param>
        public abstract void SetParameter(string ParamName, object value);

        /// <summary>
        /// Remove a parameter by it's name
        /// </summary>
        /// <param name="ParamName"></param>
        public abstract void RemoveParameter(string ParamName);

        /// <summary>
        /// Get Parameter value by it's name
        /// </summary>
        /// <param name="ParamName"></param>
        /// <returns></returns>
        public abstract object GetParameter(string ParamName);

        /// <summary>
        /// Clear all command Parameters
        /// </summary>
        public abstract void ClearParameters();

        /// <summary>
        /// Get the DataReader
        /// </summary>
        public abstract System.Data.IDataReader Reader { get; }

        /// <summary>
        /// Execute the Command and make the reader ready
        /// </summary>
        public abstract void ExecuteReader();

        /// <summary>
        /// Execute the command in NonQuery mode
        /// </summary>
        public abstract void ExecuteNonQuery();

        /// <summary>
        /// Close the connection
        /// </summary>
        public abstract void Close();

        public iDataAccess(string ConnectionString)
        {
            //No defination needed, it is to force declaration of a constractor
        }

    }
}